/*
 * @Author: gezhigang
 * @Date: 2020-08-13 14:24:47
 */
import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
import Home from "../views/index.vue";
import Login from "../views/login/index.vue";

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
    {
        path: "*",
        meta: {
            title: 'DEMO'
        },
        redirect: '/login'
    },
    {
        path: "/",
        meta: {
            title: 'DEMO'
        },
        component: Home
    },
    {
        path: '/login',
        meta: {
            title: 'login'
        },
        component: Login
    }
];

const router = new VueRouter({
    // mode: "history",
    base: process.env.BASE_URL,
    routes
});

// router.beforeEach((to, from, next) => {
//     next()
// })

export default router;
